<%@ page import="java.sql.*" contentType="text/html;charset=windows-1252"%>
<%
  //in:
  //out:article id,article name,author

 //making connection
   Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
   String url = "jdbc:odbc:iranhk";
   Connection con = DriverManager.getConnection(url, "iranhk", "iranhk");

 //get result of search 
 String st;
 PreparedStatement pst;
  st=
      "select tb_articles.id,tb_articles.name,tb_members.id authorid ,tb_members.name author " +
      "from tb_articles,tb_members,tb_tools "+
      "where "+
         "(tb_articles.fk_author_id=tb_members.id) and "+
         "(tb_articles.fk_rel_tool=tb_tools.id(+)) "+
      "order by tb_articles.dat;";
     pst=con.prepareStatement(st);
     ResultSet rst=pst.executeQuery();    
     session.setAttribute("resultSet",rst);
     //out.print(pst.toString());
    /* while (rst.next()){ 
      out.print(rst.getString("NAME"));
    }*/
%>

<jsp:include page="../displayer/articles.jsp" flush="true"/>
